frontpage

package
v0.0.0-...-94bc88a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: ISC Imports: 14 Imported by: 0

Documentation

Overview

Package frontpage contains the page that's displayed on the Hacker News window when it's first started.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentsViewer

type CommentsViewer interface {
	ViewComments(post *Post)
}

CommentsViewer describes the parent that can view posts.

type Post

type Post struct {
	*adaptive.LoadablePage
	// contains filtered or unexported fields
}

Post is a HackerNews post widget.

func NewPost

func NewPost(id hackernews.ItemID) *Post

NewPost creates a new post.

func (*Post) ConnectShowComments

func (p *Post) ConnectShowComments(f func())

ConnectShowComments connects f to be called when the user clicks the comments button. Without calling this, the comments button is hidden.

func (*Post) ID

func (p *Post) ID() hackernews.ItemID

ID returns the Post's item ID.

func (*Post) Item

func (p *Post) Item() *hackernews.Item

Item returns the post's HackerNews Item, or nil if the Post doesn't yet have one.

func (*Post) SetError

func (p *Post) SetError(err error)

SetError sets the error for the post while it's fetched.

func (*Post) SetItem

func (p *Post) SetItem(item *hackernews.Item)

type View

type View struct {
	*gtk.ScrolledWindow
	// contains filtered or unexported fields
}

View is the frontpage view.

func NewView

func NewView(ctx context.Context, parent CommentsViewer) *View

NewView creates a new View instance.

func (*View) Refresh

func (v *View) Refresh(done func())

Refresh refreshes the whole view.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL